package io;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class ConstantReader {

	private String fileName;
	private int numberOfLines;
	
	public ConstantReader(String name, int numberOfLines) {
		fileName = name;
		this.numberOfLines = numberOfLines;
	}
	
	public Double[][] getConstantArray() {
		Double[][] values = new Double[200][6];
		BufferedReader reader;
		try {
			reader = new BufferedReader(new FileReader(fileName));
			for(int i = 0; i < numberOfLines; i++) {
				String str = reader.readLine();
				String[] strings = str.split(";");
				for(int j = 1; j < 7; j++) {
					values[i][j - 1] = Double.parseDouble(strings[j].split("=")[1]);
				}
			}
			
			reader.close();
			return values;
		}
		catch(IOException e) {
			e.printStackTrace();
		}
		
		return null;
	}
}